package com.ruoyi.user.service.impl;

import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.user.domain.FamilyVideo1;
import com.ruoyi.user.mapper.FamilyVideo1Mapper;
import com.ruoyi.user.service.IFamilyVideo1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 家庭视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyVideo1ServiceImpl implements IFamilyVideo1Service
{
    @Autowired
    private FamilyVideo1Mapper familyVideo1Mapper;

    /**
     * 查询家庭视频
     * 
     * @param id 家庭视频主键
     * @return 家庭视频
     */
    @Override
    public FamilyVideo1 selectFamilyVideoById(Long id)
    {
        return familyVideo1Mapper.selectFamilyVideoById(id);
    }

    /**
     * 查询家庭视频列表
     * 
     * @param familyVideo1 家庭视频
     * @return 家庭视频
     */
    @Override
    public List<FamilyVideo1> selectFamilyVideoList(FamilyVideo1 familyVideo1)
    {
        return familyVideo1Mapper.selectFamilyVideoList(familyVideo1);
    }

    /**
     * 新增家庭视频
     * 
     * @param familyVideo1 家庭视频
     * @return 结果
     */
    @Override
    public int insertFamilyVideo(FamilyVideo1 familyVideo1)
    {
        familyVideo1.setCreateTime(DateUtils.getNowDate());
        return familyVideo1Mapper.insertFamilyVideo(familyVideo1);
    }

    /**
     * 修改家庭视频
     * 
     * @param familyVideo1 家庭视频
     * @return 结果
     */
    @Override
    public int updateFamilyVideo(FamilyVideo1 familyVideo1)
    {
        familyVideo1.setUpdateTime(DateUtils.getNowDate());
        return familyVideo1Mapper.updateFamilyVideo(familyVideo1);
    }

    /**
     * 批量删除家庭视频
     * 
     * @param ids 需要删除的家庭视频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyVideoByIds(Long[] ids)
    {
        return familyVideo1Mapper.deleteFamilyVideoByIds(ids);
    }

    /**
     * 删除家庭视频信息
     * 
     * @param id 家庭视频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyVideoById(Long id)
    {
        return familyVideo1Mapper.deleteFamilyVideoById(id);
    }
}
